\(\int \frac {\sec ^2(a+b \log (c x^n))}{x} \, dx\) [246]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 18 \[ \int \frac {\sec ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\tan \left (a+b \log \left (c x^n\right )\right )}{b n} \]

[Out]

tan(a+b*ln(c*x^n))/b/n

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3852, 8} \[ \int \frac {\sec ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\tan \left (a+b \log \left (c x^n\right )\right )}{b n} \]

[In]

Int[Sec[a + b*Log[c*x^n]]^2/x,x]

[Out]

Tan[a + b*Log[c*x^n]]/(b*n)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \sec ^2(a+b x) \, dx,x,\log \left (c x^n\right )\right )}{n} \\ & = -\frac {\text {Subst}\left (\int 1 \, dx,x,-\tan \left (a+b \log \left (c x^n\right )\right )\right )}{b n} \\ & = \frac {\tan \left (a+b \log \left (c x^n\right )\right )}{b n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\tan \left (a+b \log \left (c x^n\right )\right )}{b n} \]

[In]

Integrate[Sec[a + b*Log[c*x^n]]^2/x,x]

[Out]

Tan[a + b*Log[c*x^n]]/(b*n)

Maple [A] (verified)

Time = 1.90 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.06

method result size
derivativedivides \(\frac {\tan \left (a +b \ln \left (c \,x^{n}\right )\right )}{b n}\) \(19\)
default \(\frac {\tan \left (a +b \ln \left (c \,x^{n}\right )\right )}{b n}\) \(19\)
parallelrisch \(-\frac {2 \tan \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )}{b n \left ({\tan \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )}^{2}-1\right )}\) \(45\)
risch \(\frac {2 i}{b n \left (\left (x^{n}\right )^{2 i b} c^{2 i b} {\mathrm e}^{-b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}} {\mathrm e}^{b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )} {\mathrm e}^{b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}} {\mathrm e}^{-b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )} {\mathrm e}^{2 i a}+1\right )}\) \(118\)

[In]

int(sec(a+b*ln(c*x^n))^2/x,x,method=_RETURNVERBOSE)

[Out]

tan(a+b*ln(c*x^n))/b/n

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.83 \[ \int \frac {\sec ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )}{b n \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )} \]

[In]

integrate(sec(a+b*log(c*x^n))^2/x,x, algorithm="fricas")

[Out]

sin(b*n*log(x) + b*log(c) + a)/(b*n*cos(b*n*log(x) + b*log(c) + a))

Sympy [F]

\[ \int \frac {\sec ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\int \frac {\sec ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{x}\, dx \]

[In]

integrate(sec(a+b*ln(c*x**n))**2/x,x)

[Out]

Integral(sec(a + b*log(c*x**n))**2/x, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 165 vs. \(2 (18) = 36\).

Time = 0.22 (sec) , antiderivative size = 165, normalized size of antiderivative = 9.17 \[ \int \frac {\sec ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {2 \, {\left (\cos \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right ) \sin \left (2 \, b \log \left (c\right )\right ) + \cos \left (2 \, b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )\right )}}{2 \, b n \cos \left (2 \, b \log \left (c\right )\right ) \cos \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right ) + {\left (b \cos \left (2 \, b \log \left (c\right )\right )^{2} + b \sin \left (2 \, b \log \left (c\right )\right )^{2}\right )} n \cos \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )^{2} - 2 \, b n \sin \left (2 \, b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right ) + {\left (b \cos \left (2 \, b \log \left (c\right )\right )^{2} + b \sin \left (2 \, b \log \left (c\right )\right )^{2}\right )} n \sin \left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )^{2} + b n} \]

[In]

integrate(sec(a+b*log(c*x^n))^2/x,x, algorithm="maxima")

[Out]

2*(cos(2*b*log(x^n) + 2*a)*sin(2*b*log(c)) + cos(2*b*log(c))*sin(2*b*log(x^n) + 2*a))/(2*b*n*cos(2*b*log(c))*c
os(2*b*log(x^n) + 2*a) + (b*cos(2*b*log(c))^2 + b*sin(2*b*log(c))^2)*n*cos(2*b*log(x^n) + 2*a)^2 - 2*b*n*sin(2
*b*log(c))*sin(2*b*log(x^n) + 2*a) + (b*cos(2*b*log(c))^2 + b*sin(2*b*log(c))^2)*n*sin(2*b*log(x^n) + 2*a)^2 +
 b*n)

Giac [F]

\[ \int \frac {\sec ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\int { \frac {\sec \left (b \log \left (c x^{n}\right ) + a\right )^{2}}{x} \,d x } \]

[In]

integrate(sec(a+b*log(c*x^n))^2/x,x, algorithm="giac")

[Out]

integrate(sec(b*log(c*x^n) + a)^2/x, x)

Mupad [B] (verification not implemented)

Time = 29.01 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.61 \[ \int \frac {\sec ^2\left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {2{}\mathrm {i}}{b\,n\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}+1\right )} \]

[In]

int(1/(x*cos(a + b*log(c*x^n))^2),x)

[Out]

2i/(b*n*(exp(a*2i)*(c*x^n)^(b*2i) + 1))